<template>
    <v-row>
        <v-col>
            <v-text-field
                    :label="label"
                    :type="show ? 'text' : 'password'"
                    :append-icon="show ? 'mdi-eye' : 'mdi-eye-off'"
                    @click:append="show = !show"
                    :value="password"
                    :rules="[passwordRule]"
                    autocomplete="off"
                    @input="$emit('update:password', $event)"
            >
            </v-text-field>
        </v-col>
    </v-row>
</template>

<script>
    import {passwordRule} from "../../util/rule";

    export default {
        name: "MyPasswordInput",
        props: {
            label: {
                default: '密码'
            },
            password: {
                default: ''
            }
        },
        data() {
            return {
                passwordRule,
                show: false
            }
        }
    }
</script>

<style scoped>

</style>